package com.yingxin.yx.framework.commons.activiti.dto;

import com.yingxin.yx.framework.commons.activiti.ApprovalStatusHelper;
import com.yingxin.yx.framework.commons.activiti.enums.AuditAction;
import com.yingxin.yx.framework.commons.dto.AttachmentDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Data
public class AuditDto implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "流程实例id ")
    private String processInstanceId;

    @ApiModelProperty(value = "任务id ")
    private String taskId;

    @ApiModelProperty(value = "备注 ")
    private String comment;

    @ApiModelProperty(value = "通过并结束 ")
    private String finalFlag;

    private AuditAction action;

    private Map<String, Object> variables;

    private String formKey;

    @ApiModelProperty(value = "进项减少 ")
    private String incomeSubtract;

    private String processDefinitionId;

    private String businessType;

    private String businessId;

    private String businessNo;

    private String approvalStatus;

    //自定义表单
    private String customFormId;

    /**
     * 转办人
     */
    private String userId;

    public String getApprovalStatusName() {
        return ApprovalStatusHelper.getName(approvalStatus);
    }

    @ApiModelProperty(value = "附件ids")
    private List<AttachmentDto> taskAttachmentList;

    public void addBizInfo(String businessId, String businessNo, String businessType) {
        this.businessId = businessId;
        this.businessNo = businessNo;
        this.businessType = businessType;
    }

    @ApiModelProperty(value = "验证是否pc端还是app端")
    private String PcOrApp;

    @ApiModelProperty(value = "折扣金额")
    private BigDecimal discountAmt;

    @ApiModelProperty(value = "是否APP审核")
    private String isAppApproval;

    @ApiModelProperty(value = "损失金额")
    private BigDecimal amt;

    @ApiModelProperty(value = "类型：NB = 内部，WB = 外部，XJ = 现金")
    private String bruiseType;

    @ApiModelProperty(value = "责任人")
    private String personLiable;

    /**
     * 是否罚款： 0 否，1 是
     */
    private String isPenalty;

    /**
     * 免罚原因
     */
    private String avoidPenaltyReason;

    /**
     * 罚款金额
     */
    private BigDecimal penaltyMoney;

    /**
     * 罚款ID
     */
    private String penaltyMoneyId;

    /**
     * 其他金额
     */
    private BigDecimal otherMoney;

}
